The need to have decisions or actions approved by a more senior colleague is a daily occurrence in every business. Approval Flows streamline the process and reduce the amount of time that employees must spend following up on requests. In the video in this lesson, you saw that the Twitter Approval flow, was a positive step for Contoso as it enabled the social media team to have and control over the company tweets seen by customers and the wider public.

Exercise Scenario

In this exercise, you will be creating an approval flow which will allow a colleague to approve or reject a request. In the Twitter example that you saw demonstrated, the flow added a yes/no response to a column in a SharePoint list. For this flow, you will be utilizing Power Automates ability to perform actions such as moving files from one folder to another.

In the company you work for, customers might be eligible for a discount on orders if they meet certain criteria. The Sales Manager must approve the discount and the current approval process involves only emails. The sales staff email the customer details to the manager and then wait for them to respond. As a result, both the person requesting the discount approval and the person authorizing it, can miss the emails or not answer them.

This automated Approval flow will begin with sales staff saving an approval request document containing customer details in a designated folder. This triggers an email to the manager, which contains two simple buttons that allow the manager to easily approve or reject the discount. As soon as they have selected approve or reject and click on send, the flow will move the request document to a different folder. The folder that the flow chooses is determined by the response that the manager has made.

Setup

Since this is an Approval process, you will need to collaborate with a colleague who will approve or reject the request.

Create three folders in your OneDrive before beginning the exercise. Name the folders FlowRequest , FlowApprove and FlowReject .

Flow Creation

Task #1 – Setting up the Trigger

For this flow, you should begin with a template as it will build a flow framework for you which you can then customize.

In Power Automate click on Templates and use the search box to find the correct OneDrive for Business template for this flow.

In the authentication step, sign in if necessary.

You will need to add the FlowRequest Folder name in the first stage box – the trigger step. You can use the folder symbol to the right to pick the correct folder name.

Task #2 – Nominating Approvers in Start an Approval

In the 'Assigned to' field add the email address, or addresses, of the colleagues who will be approving this discount. Note that by default it says 'First to Respond' which means that a single response will trigger the next step.

When you are completing steps in this flow, you will often see Dynamic Content suggestions appearing. You can ignore these and move when you do not need to select one of the suggestions provided.

Task #3 – Check the Condition

The template has already pre-populated the condition for you. If you wish to check what condition it has added, in the Create File Scope step, click on the Expand Condition link to see the full entry.

Task #4 – The If Yes step.

Several fields in the If Yes step will be pre-populated. The flow will create a new version of the file in the designated folder and then delete the original from the FlowRequest folder. The Dynamic Content entries for these steps have already been added.

Use the folder picker icon to identify the folder where you want the flow to recreate the request document if the request is approved.

Task #5 – Create the If No step.

Click on the If No step and then on add action.

You will now need to add a Create Action under the If No and then a Delete Action under that. When you are adding the action steps there will be a long list of possibilities, but you can use the search box at the top of the Dynamic Content list to narrow the search for the one you require.

Customize the two steps so that they match the following example. Notice that the Dynamic Content elements here are the same as those in the If Yes step but you use the folder picker to add the FlowReject folder.

Task # 6 – Save the flow and test it.

Save the flow and then click on Test.

Add a document to the FlowRequest folder in your OneDrive.

Ask your colleague to check for the email and respond.

Check the FlowRequest, FlowApprove, FlowReject folders. The file should now have moved to a different folder.